<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->id();
            $table->string('title', 100)->comment('文章标题');
            $table->timestamp('publish_time')->nullable()->comment('发布时间');
            $table->string('description', 255)->nullable()->comment('文章描述');
            $table->longText('content')->comment('富文本内容');
            $table->string('key', 50)->unique()->comment('文章标识，用于区分不同类型的协议');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('articles');
    }
};